"use strict";
cc._RF.push(module, '8a7c00J7MFMTadO/T7qBnrE', 'GameCtrl');
// script/poker_project/gameView/GameCtrl.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SplashScene_1 = require("../SplashScene");
var GameDB_1 = require("./GameDB");
var GameEvent_1 = require("./GameEvent");
//裁判，隶属于GameScene,牌局管理者，准备好扑克牌，桌子等等
var GameCtrl = /** @class */ (function () {
    function GameCtrl() {
        this.m_GameDB = null;
        this.m_GameView = null;
    }
    GameCtrl.prototype.Init = function (gameView) {
        this.m_GameView = gameView;
        SplashScene_1.default.eventTarget.on(GameEvent_1.default.INIT_POKER, this.m_GameView.OnEventInit, this.m_GameView);
        SplashScene_1.default.eventTarget.on(GameEvent_1.default.PLAY, this.m_GameView.OnEventPlay, this.m_GameView);
        SplashScene_1.default.eventTarget.on(GameEvent_1.default.INIT_GROUP_CARD, this.m_GameView.OnEventINitGroupCard, this.m_GameView);
        this.m_GameView.on(GameEvent_1.default.CLICK_POKER, this.m_GameDB.OnEventClickPoker, this.m_GameDB);
        this.m_GameDB = GameDB_1.default.Create();
    };
    GameCtrl.prototype.Play = function () {
        //移动所有牌到发牌区
        this.m_GameDB.Play();
    };
    GameCtrl.prototype.Exit = function () {
        SplashScene_1.default.eventTarget.off(GameEvent_1.default.INIT_POKER, this.m_GameView.OnEventInit);
        SplashScene_1.default.eventTarget.off(GameEvent_1.default.PLAY, this.m_GameView.OnEventPlay);
        SplashScene_1.default.eventTarget.off(GameEvent_1.default.INIT_GROUP_CARD, this.m_GameView.OnEventINitGroupCard);
        this.m_GameView.off(GameEvent_1.default.INIT_GROUP_CARD, this.m_GameView.OnEventINitGroupCard);
        // SplashScene.eventTarget.off(GameEvent.CLICK_POKER,this.m_GameDB.OnEventClickPoker);
    };
    return GameCtrl;
}());
exports.default = GameCtrl;
// export class PokerGroup{
//     public pokers: Poker[] = [];
// }

cc._RF.pop();